# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=ukui-greeter
pkgver=3.0.3
pkgrel=5
pkgdesc="Lightdm greeter for UKUI"
arch=('loong64' 'x86_64')
license=('GPL')
url="https://github.com/ukui/ukui-greeter"
groups=('ukui')
depends=('imlib2' 'liblightdm-qt5' 'libxrandr' 'libxtst' 'opencv' 'qt5-svg' 'qt5-x11extras')
makedepends=('qt5-tools' 'openmpi' 'pugixml' 'jsoncpp' 'fmt' 'vtk' 'glew' 'hdf5')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ukui/ukui-greeter/archive/v$pkgver.tar.gz")
sha512sums=('848b0aa1d8c077507ddca5cdd56c0fd896e198f5a1885ae7f5974742c388da3d1f2052e99febaf14930248f64262e80a5cda4424de29edc4b692bb3f1e707402')

prepare() {
  cd ukui-greeter-$pkgver
  sed -i 's|target.path = /usr/sbin/|target.path = /usr/bin/|' ukui-greeter/ukui-greeter.pro
  sed -i 's|gio-unix-2.0|glib-2.0|' ukui-greeter/BiometricAuth/giodbus.cpp
}

build() {
  cd ukui-greeter-$pkgver
  qmake-qt5 PREFIX=/usr QMAKE_LFLAGS="${LDFLAGS}"
  make
}

package() {
  cd ukui-greeter-$pkgver
  make INSTALL_ROOT="$pkgdir" install
}
